package com.kitty.game.market.message.vo;

import com.kitty.game.market.model.MarketTransactionRecord;
import lombok.Data;

@Data
public class GoldTransactionVo {
    /*
     item.name = pkt:GetLenString()
    item.level = pkt:GetShort()
    item.time = pkt:GetLong()
    item.endTime = pkt:GetLong()
    item.price = pkt:GetLong()
    item.status = pkt:GetShort()
    item.req_level = pkt:GetShort()
    item.item_polar = pkt:GetChar()
    item.stall_item_type = pkt:GetChar()
    item.record_id = pkt:GetLenString()
    item.buy_type = pkt:GetChar()
     */

    private String name;

    private short level;

    private int time;

    private int endTime;

    private int price;

    private short status;

    private short req_level;

    private byte item_polar;

    private byte stall_item_type;

    private String record_id;

    private byte type;

    public static GoldTransactionVo valueOf(MarketTransactionRecord record) {
        GoldTransactionVo vo = new GoldTransactionVo();
        vo.setName(record.getName());
        vo.setEndTime(record.getEndTime());
        vo.setItem_polar(record.getItem_polar());
        vo.setStall_item_type((byte)1);
        vo.setLevel(record.getLevel());
        vo.setPrice(record.getPrice());
        vo.setRecord_id(record.getRecord_id());
        vo.setTime(record.getTime());
        vo.setStatus((byte)record.getStatus());
        vo.setReq_level((byte)record.getReq_level());
        vo.setType((byte)record.getType());
        return vo;
    }


}
